#ifndef _INCLUDE_H_
#define _INCLUDE_H_

#include "ace/OS.h"

#include "ace/Connector.h"

#include "ace/os_include/os_netdb.h"
#include "ace/OS_NS_errno.h"
#include "ace/INET_Addr.h"
#include "ace/SOCK_Stream.h"
#include "ace/SOCK_Acceptor.h"
#include "ace/Log_Msg.h"
#include "ace/Time_Value.h"
#include "ace/Date_Time.h"

#include "ace/SOCK_Connector.h"
#include "ace/Process_Mutex.h"
#include "ace/Codecs.h" 

#include "ace/Process.h"
#include "ace/Process_Manager.h"

#include "ace/SPIPE_Acceptor.h"
#include "ace/SPIPE_Connector.h"

#include "ace/Pipe.h"

#include "ace/Synch.h" 

#include "ace/TP_Reactor.h"
#include "ace/Reactor.h"

#include "ace/Svc_Handler.h"

#include "ace/OS_NS_dirent.h"

#include "ace/Acceptor.h"

#include "ace/Memory_Pool.h"
#include "ace/Malloc.h"
#include "ace/Malloc_T.h"
#include "ace/PI_Malloc.h"

#include "ace/UUID.h"

#include "json/json.h"

#include <set> 
#include <map> 
#include <queue>
#include <stdexcept> 


#ifndef ACE_WIN32
#include "ace/Signal.h"
#endif









#define ORG_COPY







#define CONTROLLER_NAME "ALIVE_RENDERER_CONTROLLER"
#define AGENT_NAME "ALIVE_RENDERER_AGENT"
#define BACKUP_MANAGER_NAME "ALIVE_BACKUP_MANAGER"
#define SCALER_NAME "ALIVE_SCALER"

#define FADE_MARGINE 0.05

#define ALPHA_UNIT 0.1
#define ROTATION_UNIT 0.02 









#define MAX_CPU_MULTIPLE	5					

#define LOGO_IMG	"alive_logo.png"			
#define DEFAULT_BACK_IMG "default_back.png"		
#define BLANK_IMG	"blank.png"					
#define SILENT_SOUND	"nosound.mp3"				

#define LIST_FILE "list.txt"			

#ifdef ACE_WIN32 
	#define MAX_CMD_LENGTH	8198	
	#define DELETE_CMD "del"
	#define COPY_CMD "copy"
#else
	#define MAX_CMD_LENGTH	2621440	
	#define DELETE_CMD "rm"
	#define COPY_CMD "cp"
#endif

#define ONCE_EFFECT_COUNT 20 
#define DB_CONNECTION_TRY_COUNT 5






#define ORG_EXT ".mov"
#define OUT_EXT	".mp4"
#define IMG_EXT	".png"
#define THUMBNAIL_EXT ".jpg"











typedef std::vector<std::string> string_vector;
typedef  unsigned char BYTE;
#define MAX_BUFFER 1024 * 200 
#define LENGTH_SIZE 4
#define SETTING_FILE "setting"
#define LOG_RETRY_COUNT 5 
#define GET_OBJECT_FILE_RETRY_COUNT 3 

typedef enum { _SUCCEEDED_JOB , _FAILED_JOB} _RESERVED_TYPE;
typedef enum{  WORK_RESULT_SUCCESS					
		, WORK_RESULT_ERR_SCRIPT_STRUCTURE
		, WORK_RESULT_ERR_SCRIPT_CONTENT
		, WORK_RESULT_ERR_RENDERING_PARAM
		, WORK_RESULT_ERR_INVALID_PATH
		, WORK_RESULT_ERR_FILE_OPEN
		, WORK_RESULT_ERR_RENDERING_EXE
		, WORK_RESULT_ERR_RENDERER_DISCONNECT} _WORK_RESULT_TYPE;
typedef enum{_SUCCESS , _FAIL , _INVALID_CMD } _RESULT_TYPE;
typedef enum{_OS_CMD , _EXE_FILE } _PROCESS_TYPE;
typedef enum{_PROCESS_LOG , _JOB_LOG , _EC2_LOG ,  _SCALING_LOG , _OBJECT_LOG} _LOG_TYPE;
typedef enum{_INFO , _REQUIRED , _ERROR } _LOG_MODE;

typedef enum{_UNREGISTERED ,  _RUNNING , _STOPPING , _STOPPED } _SOCKET_STATE;


typedef enum{_DB_SUCCESS , _DB_EXE_ERROR , _DB_NO_CONNECTION , _DB_STMT_ERROR , _DB_PREPARE_ERROR , _DB_BIND_PARAM_ERROR ,_DB_BIND_RESULT_ERROR, _DB_STORE_ERROR} _DB_RESULT;




 


#endif
